#! /usr/bin/env bash
which tmux || brew install -y tmux
which zip || brew install -y zip
which vim || brew install -y vim
which jq || brew  install -y jq
which tree || brew  install -y tree
which wget || brew  install -y wget
#which pandoc || brew  install pandoc
which colordiff || brew  install colordiff
git config --global credential.helper "cache --timeout=3600"
git config --global core.editor "/usr/bin/vim"
git config --global user.name "Andy Zhang"
git config --global user.email "leowa@outlook.com"
git config --global core.filemode "true"
grep interactive ~/.gitconfig || echo "[color]
  diff = auto
  status = auto
  branch = auto
  interactive = auto
  ui = true
  pager = true
" >> ~/.gitconfig
cd `dirname $0`
\rm ~/.tmux.conf
ln -s -f `pwd`/conf/tmux.conf ~/.tmux.conf
ln -s -f `pwd`/conf/bash_profile ~/.bash_profile
ln -s -f `pwd`/conf/bash_aliases ~/.bash_aliases
cd -

[ -d ~/.ssh ] || mkdir ~/.ssh
[ -f ~/.ssh/config ] || touch ~/.ssh/config
cat <<'EOF'>>~/.ssh/config
# connection alive setting
TCPKeepAlive no
ServerAliveInterval 60
ServerAliveCountMax 10
EOF
#grep bash_alias ~/.bashrc > /dev/null || echo "source ~/.bash_alias" >> ~/.bashrc
#grep PS1 ~/.bashrc || echo "PS1=\"\[\033[01;31m\]\u@$(ifconfig eth0 | grep 'inet ' | awk ' {print $2}') \w $\[\033[00m\]\"" >> ~/.bashrc
#\cp `dirname $0`/bash_alias ~/.bash_alias
#cds manifest github.com/vchs/dbaas-release/manifests/releases/dbaas.yml --save=release.yml
#rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#yum -y install lighttpd
#git clone https://github.com/vchs/dbaas-release.git ~/dbaas-release
